﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<dbPoll_Application.Models.MessageModels>" %>

     <% using (Html.BeginForm("Run", "Poll", FormMethod.Post, new { @id = "messageForm" }))
       {%>
    <% Html.ValidationSummary(true); %>
    <%=Html.HiddenFor(model => model.PollID) %>
    <table>
    <tr>
    <td><label>Message:</label></td>
    </tr>
    <tr>
    <td colspan="2"><%= Html.TextAreaFor(model => model.Message, new { @id="messageText", rows = "5" })%></td>
    <td style="float:left"><%= Html.ValidationMessageFor(model => model.Message)%></td>
    </tr>
    <tr>
    <td><input type="submit" id="sendMessage" value="Send"/></td>
    <td id="loading" style="display:none"><img src="../Resources/ajax-loader.gif" /> Sending...</td>
    <td id="status" style="display:none"><%= ViewData["status"]%></td>
    </tr>
    </table>
    <%= Html.ValidationSummary(true)%>
    <% } %>   
